home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_i_l / incx101b.zip / INC-PROG.LZH / INC.BAT < prev    next >
DOS Batch File  |  1991-07-30  |  8KB  |  187 lines

  1. echo off
  2. cls
  3. goto start
  4. :usage
  5. echo .=================================================================
  6. echo .===== inc.bat -- Invoke InContext Work Environment Manager  =====
  7. echo .=====                                                       =====
  8. echo .===== usage:                                                =====
  9. echo .=====        inc [ -nm ] [ -nd ] [ -u initials ] [ dir ]    =====
  10. echo .=====                                                       =====
  11. echo .===== where:                                                =====
  12. echo .=====        -nm   ignore mouse driver                      =====
  13. echo .=====        -nd   suppress full initial disk logging       =====
  14. echo .=====        -u    select user by (three) initials          =====
  15. echo .=====                 (requires prior setup)                =====
  16. echo .=====        dir   InContext installation directory         =====
  17. echo .=====                                                       =====
  18. echo .===== examples:                                             =====
  19. echo .=====        inc                                            =====
  20. echo .=====        inc -nd c:\myplace                             =====
  21. echo .=====        inc -u mar d:\incontxt                         =====
  22. echo .=====                                                       =====
  23. echo .=== Copyright 1991 Rams' Island Software All Rights Reserved ====
  24. echo .== 1991 Rams' Island Software, 8 Grand Place, Newtown CT 06470 ==
  25. echo .=================================================================
  26. echo .
  27. echo .
  28. goto done
  29.  
  30. rem ----- Check arguments -------------------------------------------
  31. :start
  32. if %1. == help.      goto usage
  33. if %1. == .          goto default
  34. goto do_inc
  35.  
  36. rem ----- If invoked without arguments, verify default --------------
  37. rem -----   installation (i.e., in c:\incontxt         --------------
  38. :default
  39. if not exist c:\incontxt\errmsg.dat goto nosuch
  40.  
  41. rem ===== Invoke InContext Work Environment Manager =================   
  42. :do_inc
  43. incontxt %1 %2 %3 %4
  44.  
  45. rem ----- Check returned error code ---------------------------------
  46. if errorlevel 99 goto error99
  47. if errorlevel 98 goto error98
  48. if errorlevel 9 goto error9
  49. if errorlevel 2 goto error2
  50. if errorlevel 1 goto error1
  51.  
  52. rem ===== Handle "unload" to invoke application =====================   
  53. rem =====                                                       =====
  54. rem =====   InContext uses a simple batch file "trick" to allow =====
  55. rem =====   it to completely unload itself before executing an  =====
  56. rem =====   application.  This is rarely necessary, because     =====
  57. rem =====   almost all applications can run "under" InContext.  =====
  58. rem =====   When an application needs ALL available memory,     =====
  59. rem =====   though, it can be invoked with a procedure that     =====
  60. rem =====   includes an "!unload" command (see User Guide for   =====
  61. rem =====   details).  When that is done, InContext will write  =====
  62. rem =====   a batch file and then terminate.  The batch file    =====
  63. rem =====   you're NOW reading detects the presence of that     =====
  64. rem =====   other batch file, invokes it, and then re-invokes   =====
  65. rem =====   InContext.                                          =====
  66. rem =====                                                       =====
  67. rem =====   If you don't use "unload", this batch file need not =====
  68. rem =====   be changed.  If you use the default location for    =====
  69. rem =====   the InContext installation directory (c:\incontxt)  =====
  70. rem =====   and for the temporary batch file (c:\temp.bat) that =====
  71. rem =====   InContext writes out, then this batch file should   =====
  72. rem =====   execute an "unload" correctly.  Otherwise, you will =====
  73. rem =====   need to make appropriate adjustments to the next    =====
  74. rem =====   five lines (not counting "rem" comment lines).      =====
  75.  
  76. rem ----- The next three lines must correctly reference the  --------
  77. rem ----- temporary batch file written by InContext.  The    --------
  78. rem ----- pathname of that file is set in Misc Options Exec. --------
  79. if not exist c:\temp.bat goto done
  80. call c:\temp.bat
  81. del c:\temp.bat
  82.  
  83. rem ----- The following two lines are necessary only if you do   ----
  84. rem ----- not have the incontxt.exe executable in your DOS path. ----
  85. rem ----- They are needed in order to restore the current        ----
  86. rem ----- working directory to the location of that file so that ----
  87. rem ----- it can be executed.                                    ----
  88. c:
  89. cd \incontxt
  90. goto do_inc
  91.  
  92. rem ===== Error Displays ============================================   
  93. :error1
  94. echo .
  95. echo .
  96. echo .
  97. echo Incontext was unable to continue because the swap file could not
  98. echo be read upon return from a subprogram.  Press any key and InContext
  99. echo will restart.
  100. pause
  101. goto do_inc
  102.  
  103. :error2
  104. echo .
  105. echo .
  106. echo .
  107. echo InContext was unable to continue because the swap file was deleted
  108. echo while executing a sub-program.  Press any key and Incontext will
  109. echo restart.
  110. pause
  111. goto do_inc
  112.  
  113. :error9
  114. echo .
  115. echo .
  116. echo .
  117. echo InContext was unable to continue because of an error in attempting
  118. echo to read the swap file back from EMS memory after returning from a
  119. echo subprogram.  You may be attempting to execute an ill-behaved EMS
  120. echo program.  It is suggested that you select the InContext option that
  121. echo disables its use of EMS memory for a swap file.  Press any key and
  122. echo InContext will restart.
  123. pause
  124. goto do_inc
  125.  
  126. :error98
  127. echo .
  128. echo .
  129. echo .
  130. echo InContext has incurred a memory allocation error.  While this may be
  131. echo caused by an internal program bug, it is much more likely that the
  132. echo user has selected options which exceed the amount of memory available.
  133. echo You may minimize memory usage by:
  134. echo    (1) not attempting to use the internal editor on extremely large
  135. echo        files.  Under "More Options Misc", set the "Limit editor to
  136. echo        files under (Kbytes)" option to a reasonably small value.
  137. echo        The internal editor is really intended only for use on relatively
  138. echo        small files (up to perhaps 32-64K).
  139. echo    (2) not logging all directories in all drives.  If you have many
  140. echo        disk drives, or a single drive with a very large number of
  141. echo        files and/or directories, you may need to use "Misc Options Disk"
  142. echo        to log one or more drives only "As Needed".  You may also find it
  143. echo        helpful to invoke InContext with the command "inc -nd", until you
  144. echo        get your options set the way you want them.
  145. echo .
  146. echo If you wish to prevent InContext from restarting, press Control-Break
  147. echo now.  Press any other key and InContext will restart.
  148. pause
  149. goto do_inc
  150.  
  151. :error99
  152. echo .
  153. echo .
  154. echo .
  155. echo InContext has incurred a fatal error.  The nature of the error is
  156. echo displayed just above.  If you are unable to determine and correct
  157. echo the cause of this error, please contact Rams' Island Software for
  158. echo assistance.  If you wish to prevent InContext from restarting, press
  159. echo Control-Break now.  Press any other key and InContext will restart.
  160. pause
  161. goto do_inc
  162.  
  163. :nosuch
  164. echo .
  165. echo .
  166. echo .
  167. echo You have invoked inc.bat with no arguments.  When inc.bat is used
  168. echo with no arguments, it assumes that you have installed InContext in
  169. echo the default directory (c:\incontxt).  However, inc.bat cannot find
  170. echo an InContext installation in that directory.  Perhaps you have
  171. echo chosen to install InContext in a different directory.  In that case,
  172. echo you need to specify the directory on the command line.  For example,
  173. echo if you installed the package in the directory D:\MYPLACE, you should
  174. echo invoke InContext with the command
  175. echo      inc d:\myplace
  176. echo .
  177. echo If, after reading this message, you still can't see how to proceed,
  178. echo it is suggested that you read the "Quick Start" section of the User
  179. echo Guide, in the file INCONTXT.DOC.
  180. echo .
  181. echo .
  182. echo .
  183. goto done
  184.  
  185. rem ===== Exit to DOS ===============================================   
  186. :done
  187.